﻿@model KL.Store.Web.Models.TotalStockModel
@{
    Layout = null;

    var pageToPrev = 1;
    var pageToNext = Model.PageCount;
    if (Model.Page > 7)
    {
        pageToPrev = Model.Page - 7;
    }
    if ((Model.Page + 7) < Model.PageCount)
    {
        pageToNext = Model.Page + 7;
    }
    var firstPageClass = "";
    if (Model.Page == 1)
    {
        firstPageClass = " class=\"disabled\"";
    }
    var lastPageClass = "";
    if (Model.Page == Model.PageCount)
    {
        lastPageClass = " class=\"disabled\"";
    }
}
<div class=" col-md-7  first last">
    <table class="table table-bordered table-responsive">
        <tr>
            <td>Toplam Stok Maliyeti</td>
            <td>@Model.StokToplamMaliyet.ToString("###,###,##0.00") TL</td>
        </tr>
        <tr>
            <td>Toplam Stok Adedi</td>
            <td>@Model.ToplamStokAdedi.ToString("###,###,##0")</td>
        </tr>
        <tr>
            <td>Toplam Satış Tutarı Tahmini</td>
            <td>@Model.ToplamSatisTutarTahmini.ToString("###,###,##0.00") TL</td>
        </tr>
    </table>
</div>
<div class="clearfix"></div>
<hr />
@if (Model.PageCount > 1)
{
    <ul class="pagination right">
        <li@(firstPageClass)><a href="@(ViewBag.PageUrl)?Page=1">&laquo;</a></li>
        @for (var i = pageToPrev; i <= pageToNext; i++)
        {
            <li@{ if (Model.Page == i)
                  { <text> class="active"</text>} }><a href="@(ViewBag.PageUrl)?Page=@(i)">@(i)</a></li>
        }
        <li@(lastPageClass)><a href="@(ViewBag.PageUrl)?Page=@(Model.PageCount)">&raquo;</a></li>
    </ul>
    <div class="clearfix"></div>
}
<div class="col-xs-12 hidden-md hidden-lg  first last"><span class="hidden-md hidden-lg right"><a href="javascript:void(0);" class="sectionOC" onclick="expandSection('#totalStocksReport');">Genişlet/Daralt&nbsp;<i class="fa fa-bars"></i></a></span></div>
<div class="clearfix"></div>
<div id="totalStocksReport">
    <table class="table table-bordered table-responsive">
        <thead>
            <tr>
                <td class="hideOnMobile">Stok No</td>
                <td class="hideOnMobile">Barkod</td>
                <td>Stok Adı</td>
                <td>Alış Fiyatı</td>
                <td>Satış Fiyatı</td>
                <td>Stok Sayısı</td>
            </tr>
        </thead>
        <tbody>
            @foreach (var stock in Model.TotalStockList)
            {
                <tr>
                    <td class="hideOnMobile">@stock.KartId</td>
                    <td class="hideOnMobile">@stock.Barkod</td>
                    <td><a href="@stock.LinkUrl" target="_blank">@stock.KartAdi</a></td>
                    <td>@stock.AlisFiyati.ToString("###,###,##0.00") TL</td>
                    <td>@stock.SatisFiyati.ToString("###,###,##0.00") TL</td>
                    <td>@stock.Miktar.ToString("###,###,##0")</td>
                </tr>
            }
        </tbody>
    </table>
</div>
<div class="clearfix"></div>
@if (Model.PageCount > 1)
{
    <ul class="pagination right">
        <li@(firstPageClass)><a href="@(ViewBag.PageUrl)?Page=1">&laquo;</a></li>
        @for (var i = pageToPrev; i <= pageToNext; i++)
        {
            <li@{ if (Model.Page == i)
                  { <text> class="active"</text>} }><a href="@(ViewBag.PageUrl)?Page=@(i)">@(i)</a></li>
        }
        <li@(lastPageClass)><a href="@(ViewBag.PageUrl)?Page=@(Model.PageCount)">&raquo;</a></li>
    </ul>
    <div class="clearfix"></div>
}